<script setup>
import { introApi } from "@/services/index";
import { onLoad, onShow, onReachBottom } from "@dcloudio/uni-app";
import { nextTick, ref, watch, onMounted } from "vue";
import { messageContent } from "@/services/user";

const productData = ref({});
const id = ref("");

const loading = ref("");
const getDateLst = async () => {
  try {
    let res = await messageContent({ id: id.value });
    if (res.code == 200) {
      productData.value = res.data;
    } else {
    }
    // console.log(res);
  } catch (e) {}
};
onLoad((e) => {
  id.value = e.id ? e.id : "";
  if (!e.id) {
    uni.navigateBack();
  }
  getDateLst();
});

const onClickLeft = () => {
  if (productData.value.appPath == "scTransfer") {
    uni.navigateTo({
      url:
        "/pages/transfer/record_det/index?id=" + productData.value.relationId,
    });
  }
};
</script>

<template>
  <top-nav :title="'消息详情'" :border="false" rType="save"></top-nav>

  <view class="content" @click="onClickLeft">
    <view class="item">
      <view class="title">{{ productData.title }} </view>
      <view class="des">{{ productData.createTime }}</view>

      <view class="info">
        <view>
          <up-parse :content="productData.content"></up-parse>
        </view>
        <!-- <view>单据编号：788284324</view>
        <view>调出：7</view>
        <view>调入：7</view>
        <view>件数：7</view>
        <view>总价：7</view> -->

        <!-- <view class="see">点击查看单据>></view> -->
      </view>
    </view>
  </view>
</template>

<style lang="scss" scoped>
@import "index.scss";
</style>
